﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GoF23Learning._01.Singleton
{
    /// <summary>
    /// 单件模式
    /// </summary>
    public sealed class Singleton
    {
       	private static readonly Singleton instance = new Singleton();
       	private static int totNum = 0;
        public static Singleton Instance
        {
            get
            {
                return instance;
            }
        }
        private  Singleton() { }
        public void Add()
        {
            totNum++;
        }
        public int GetCounter()
        {
            return totNum;
        }
    }
    //HttpContext.Current;
    //AppDomain.CurrentDomain
}
